﻿namespace FlashPay.ORM
{
    using System.Data;

    /// <summary>
    /// 数据库接口
    /// </summary>
    public interface IDatabase
    {
        IDbConnection Connection { get; }

        DBType DbType { get; }

        string Key { get; }
    }

    /// <summary>
    /// 数据库类对象
    /// </summary>
    public class Database : IDatabase
    {
        public IDbConnection Connection { get; private set; }

        public DBType DbType { get; private set; }

        public string Key { get; set; }

        public Database(DBType dbType, string key)
        {
            this.Key = key;
            //this.Connection = DBUtils.CreateDBConnection(dbType, key);
            this.DbType = dbType;
        }
    }
}
